<template>
  <div class="head-container">
    <!-- -->
    <div class="left-head">
      <el-button
        style="margin-right: 20px"
        @click="collapseClick"
        icon="el-icon-menu"
        size="mini"
      ></el-button>
      <el-breadcrumb separator="/">
        <el-breadcrumb-item
          v-for="item in tabList"
          :index="item.name"
          :to="{ path: item.path }"
          >{{ item.label }}
        </el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="right-head">
      <el-dropdown @command="handleCommand">
        <span class="el-dropdown-link">
          我的<i class="el-icon-arrow-down el-icon--right"></i>
        </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item command="logOut">退出</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
import Cookie from "js-cookie";
export default {
  name: "VueSysmangerTopHead",

  data() {
    return {};
  },
  computed: {
    tabList() {
      return this.$store.state.tab.tabList;
    },
  },
  mounted() {},

  methods: {
    collapseClick() {
      this.$store.commit("collapseMenu");
    },
    handleCommand(command) {
      Cookie.remove("token");
      this.$router.push("/login");
    },
  },
};
</script>
<style lang="less" scoped>
.head-container {
  background-color: #333;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 20px;
  .text {
    color: #fff;
    font-size: 14px;
    margin-left: 20px;
  }
  .left-head {
    display: flex;
    align-items: center;
    /deep/.el-breadcrumb__item {
      .el-breadcrumb__inner {
        font-weight: normal;
        &.is-link {
          color: #666;
        }
      }
      &:last-child {
        .el-breadcrumb__inner {
          color: #fff;
        }
      }
    }
  }
  /deep/.active {
    color: #fff;
  }
}
</style>